package main.resources.controller.command.category;

import main.resources.controller.command.Command;
import main.resources.controller.dao.moodle.MdlCourseCategoryDao;
import main.resources.exceptions.DaoException;
import main.resources.model.entity.moodle.MdlCourseCategory;

public class CategoryRemoveCommand implements Command {

	private MdlCourseCategory category;
	private String id;

	public CategoryRemoveCommand(String id) {
		this.id = id;
	}
	
	@Override
	public void execute() throws DaoException {
		this.category = MdlCourseCategoryDao.getInstance().find(id);
		MdlCourseCategoryDao.getInstance().remove(category);		
	}

}
